<template>
    <a-tabs v-model:activeKey="activeKey" type="editable-card" hide-add v-if="panes.length > 0" @change="change">
        <a-tab-pane v-for="(pane, index) in panes" :key="index" :tab="this.$t(`message.${pane.name}`)" :closable="true">
        </a-tab-pane>
    </a-tabs>
</template>
<script>
import useTagsViewStore from "@/store/moudle/TagView"
export default {
    data() {
        return {
            activeKey: '0',
            panes: [],
        };
    },
    mounted() {
    },
    watch: {
        $route() {
            this.panes = useTagsViewStore().visitedViews
            this.activeKey = this.panes.length
            console.log(this.panes)
        }
    },
    methods: {
        change(key) {
            console.log(key)
            this.$router.push(this.panes[key].path)
         }

    }
}
</script>